#pragma once

#define MAX_HP 1000.0f
#define MAX_POWER 1000.0f
#define MAX_SPEED 1000.0f
#define MAX_SHOOTING_SPEED 1000.0f
#define MAX_RANGE 1000.0f
#define MAX_ARMOR 100.0f

// Real damage:		Power * (armor / 100)
// Reduce hp:		CurrentHP -= Real damage

class Tank
{
private:
	const char* m_sName;
	const char* m_sTexturePath;
	int m_iHP, m_iPower, m_iSpeed, m_iShootingSpeed, m_iRange;
	float m_fArmor;
public:
	Tank();
	~Tank();
	int load(char* data_file);
	int save(char* data_file);
	void print();
public:
	const char* getName() { return m_sName; }
	int getRealDamage() { return (m_fArmor / 100.0f) * float(m_iPower); }
	int reduceHP(int damage) { return (m_iHP -= damage); }
	int getRange() { return m_iRange; }
	int getShootingSpeed() { return m_iShootingSpeed; }
	int getHP() { return m_iHP; }
	int getPower() { return m_iPower; }
	float getArmor() { return m_fArmor; }
	bool isDead(){ return (m_iHP < 0); }
};